<%--
  Created by IntelliJ IDEA.
  User: 46560
  Date: 2020/1/15
  Time: 14:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<html>
<head>
    <script type="text/javascript" src="/static/js/jquery-1.9.1.js"></script>
    <link rel="stylesheet" href="/static/css/bootstrap.min.css" type="text/css">
    <title>Title</title>
</head>
<body>
<div class="container text-center" style="margin-top: 50px">
    <h1>帖子列表</h1>
    <form action="/invitation/index" method="post">
        <tr>
            <th colspan="5">帖子标题：<input type="text" name="title" id="title">
                <input type="submit" value="搜索"></th>
        </tr>
        <table class="table table-striped">
            <caption></caption>
            <thead>
            <tr>
                <th>标题</th>
                <th>内容摘要</th>
                <th>作者</th>
                <th>发布时间</th>
                <th>操作</th>
                <th>操作</th>
            </tr>
            </thead>

            <tbody>
            <c:forEach var="p" items="${pageInfo.list}">
                <tr>
                    <td>${p.title}</td>
                    <td>${p.summary}</td>
                    <td>${p.author}</td>
                    <td><fmt:formatDate value="${p.createdate}" pattern="yyyy-MM-dd"/></td>
                    <td><a href="/?id=" class="btn btn-primary">查看回复</a></td>
                    <td><a href="/?id=" class="btn btn-primary">删除</a></td>

                </tr>
            </c:forEach>
            </tbody>
        </table>
        <div class="text-center">
            <ul class="pagination">
                <c:if test="${pageInfo.hasPreviousPage}">
                    <li><a href="/ ?pageIndex=${pageInfo.prePage}">&laquo;</a></li>
                </c:if>
                <c:forEach items="${pageInfo.navigatepageNums}" var="i">
                    <li class="${pageInfo.pageNum==i?'active':''}"><a href="/ ?pageIndex=${i}">${i}</a></li>
                </c:forEach>
                <c:if test="${pageInfo.hasNextPage}">
                    <li><a href="/ ?pageIndex=${pageInfo.nextPage}">&laquo;</a></li>
                </c:if>
            </ul>
        </div>
        <h3 class="h3">${ok}</h3>
    </form>
</div>
</body>
</html>
